package com.codefactory.generator.param;

public class PackageConfFactory {

    public static PackageConf createDefault(ProjectConf conf) throws Exception {
        //公共模块包路径
        String common = conf.projectBasePackage + ".common";
        String basePackage = conf.projectBasePackage + "." + conf.packageName;
        String model = basePackage + ".model";
        String mapper = basePackage + ".dao";
        String controller = basePackage + ".controller";
        String service = basePackage + ".service";
        String serviceImpl = basePackage + ".service.impl";
        String entityVO = basePackage + ".vo.entity";
        String requestVO = basePackage + ".vo.request";
        String responseVO = basePackage + ".vo.response";

        //Mapper插件基础接口的完全限定名
        String commonMapper = conf.projectBasePackage + ".common.core.Mapper";

        PackageConf nameConf = PackageConf.builder()
                .controller(controller)
                .mapper(mapper)
                .model(model)
                .service(service)
                .serviceImpl(serviceImpl)
                .voEntity(entityVO)
                .voRequest(requestVO)
                .voResponse(responseVO)
                .basePackage(basePackage)
                .common(common)
                .commonMapper(commonMapper)
                .build();
        return nameConf;
    }
}
